#ifndef MAGIC_TOWER_H
#define MAGIC_TOWER_H

#include <QMainWindow>
#include <QString>
#include "monster.h"
#include <QKeyEvent>
#include <QTimer>
namespace Ui {
class magic_tower;
}
class Monster
{
public:
    int hp;//生命
    int atk;//攻击
    int pdef;//防御
    int exp;//经验
    int gold;//金币
    int num=100;//怪物编号，1绿色史莱姆
    QString name;//名称
};
class magic_tower : public QMainWindow
{
    Q_OBJECT
public slots:
    //void update();
public:
    explicit magic_tower(QWidget *parent = 0);
    ~magic_tower();
    void InitBraver();//初始化勇士
    void paintEvent(QPaintEvent *event);
    void keyPressEvent(QKeyEvent *event);
    QKeyEvent *Key;
    void InitMap();
    void showthings();
    void Pickup();
    void LoadMap();
    int posy;
    int posx;
    int floor=1;
    bool IsRun=0;
    bool IsFlooring=0;
    bool IsOver=0;
    void Fight(Monster *mon);
    void LoadMonster();
    QString name;
    int level;//等级
    int hp;//生命
    int atk;//攻击
    int pdef;//防御
    int exp;//经验
    int gold;//金币
    int key1;
    int key2;
    int key3;
    QRect pos;
    QString Dialog;
    bool DiaTimeGirl=1;
    void PaintDialog();
private:
    Ui::magic_tower *ui;
};

struct Place
{
    QRect rect;
    int cover=0;//0平地，1墙，2小血瓶，3大血瓶，4红，5蓝，6金币7经验，8910黄蓝红，20怪物;80,90,100对应的门
    //11台阶
    QString name;
    Monster *mon1=nullptr;
    Place();
    ~Place();
};
#endif // MAGIC_TOWER_H
